package com.itheima.mapper;

import com.itheima.pojo.CheckGroup;
import com.itheima.pojo.CheckItem;
import com.itheima.pojo.CheckgroupItem;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

@Mapper
public interface CheckGroupItemMapper {
    @Select("select * from t_checkgroup_checkitem where checkitem_id=#{id}")
    List<CheckgroupItem> getByCheckItemId(Integer id);


    @Select("select checkitem_id from t_checkgroup_checkitem where checkgroup_id=#{groupId}")
    List<Integer> getByGroupId(Integer groupId);


    @Insert("insert into t_checkgroup_checkitem (checkgroup_id, checkitem_id) VALUES (#{id},#{checkitemId})")
    void addCheckGroupItem(Map map);

    @Delete("delete from t_checkgroup_checkitem where checkgroup_id=#{checkgroup_id}")
    void delete(Integer checkgroup_id);

}
